fix: support cross-origin iframe snapshots#1048
Open
Zqian007 wants to merge 1 commit intovercel-labs:mainfrom
Open
fix: support cross-origin iframe snapshots#1048Zqian007 wants to merge 1 commit intovercel-labs:mainfrom
Zqian007 wants to merge 1 commit intovercel-labs:mainfrom
Conversation
Contributor
|
Someone is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
…n TCP bind (vercel-labs#1041) On Windows the daemon derives a TCP port from the session name via a djb2 hash (e.g. "default" → 50838). On many machines this port falls inside Hyper-V's excluded port range (winnat), causing EACCES on bind and preventing the daemon from starting. Changes: - daemon: try the hash-derived port first; on failure, bind to port 0 (OS-assigned) and write the actual port to the .port file - client (connection.rs, stream.rs): read the .port file to discover the daemon's actual port, falling back to the hash if the file is absent - run_daemon: guard .sock file operations with #[cfg(unix)] and add .port file cleanup for #[cfg(windows)] Fixes vercel-labs#390 Co-authored-by: ctate <366502+ctate@users.noreply.github.com>
0cdc126 to
e9e25cb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix cross-origin iframe support in snapshots. The snapshot command now correctly captures content from cross-origin iframes by proactively attaching to untracked iframe targets and falling back to dedicated iframe sessions when same-origin resolution fails.
Why this matters
Previously, cross-origin iframes were silently skipped during snapshots. resolve_iframe_frame_id relies on contentDocument access, which is blocked by the same-origin policy — so any cross-origin iframe would fail and its content would be lost entirely. This meant AI agents working on pages with embedded third-party iframes (e.g. payment widgets, OAuth flows, embedded maps) had no visibility into those frames.
Additionally, Target.attachedToTarget events could arrive before the daemon was ready or be missed entirely, leaving cross-origin iframe targets unregistered in iframe_sessions even when Chrome had already attached to them.
Changes
Rust CLI (
cli/src/native/actions.rs):Rust CLI (
cli/src/native/snapshot.rs):